﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Progetto
{
    public partial class EditName : Form
    {
        public EditName()
        {
            InitializeComponent();
        }

        public string insertedText { get; set; }

        private void OK_button_Click(object sender, EventArgs e) {

            insertedText = this.InsertPlace_richTextBox.Text;

            if (insertedText.Length == 0) {
                MessageBox.Show("Please insert a valid name.", "Attention", MessageBoxButtons.OK);
                DialogResult = DialogResult.None;
            }
            else if(insertedText.Contains(" ")) {
                MessageBox.Show("Please insert a name without spaces.", "Attention", MessageBoxButtons.OK);
                DialogResult = DialogResult.None;
            }
            /* altri controlli ! */
        }
    }
}
